<script>
  import $ from 'dfish-widget'
  import Method from '../Method.vue'

  export default {
    mixins: [Method],
    data() {
      return {
        name: '$.alert(text, [position], [timeout], [yes])',
        remark: '弹出提示框。',
        attrs: [{
          name: 'text',
          remark: '显示文本',
          type: 'String',
        },{
          name: 'position',
          remark: '弹出位置(相对于document.body的位置)',
          type: 'String',
        },{
          name: 'timeout',
          remark: '定时关闭。单位:毫秒',
          type: 'Number',
        },{
          name: 'yes',
          remark: '点击确定或关闭时触发',
          type: 'Function',
        }],
        examples: [{
          remark: '弹出对话框',
          code: `
            $.alert('操作成功')
            `
        },{
          remark: '右下角弹出对话框，3秒后自动关闭',
          code: `
            $.alert('操作成功', 'br', 3000, () => console.log('close'))
            `
        }]
      }
    }
  }
</script>
